//
//  TSAlertViewManager.h
//  BaiduTravel
//
//  Created by neusoft on 8/26/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TSAlertView.h"

typedef enum
{
    TSAlertViewStyleNetworkNotReachCommonErrCode = 0,
    TSAlertViewStyleNetworkNotReachSubmitErrCode,
    TSAlertViewStyleNetworkServerErrCode,
    TSAlertViewStyleSubmittingCode,
    TSAlertViewStyleSubmittedCode,
    TSAlertViewStylePhotoSavedCode,
    TSAlertViewStyleFilterCode,
    TSAlertViewStyleWithoutLocationCode,
    TSAlertViewStyleNormalCode
} ETSAlertViewStyleCode;

@interface TSAlert: NSObject
{
	ETSAlertViewStyleCode	alertStyleCode;					
	UIImage*                alertBackgroundImage;
    NSString*               alertTitle;
	NSString*               alertMessage;
    BOOL                    isDismissByClick;
    id<TSAlertViewDelegate> delegate;
}

@property (nonatomic)		            ETSAlertViewStyleCode	alertStyleCode;
@property (nonatomic, copy)             NSString*               alertMessage;
@property (nonatomic, copy)             NSString*               alertTitle;
@property (nonatomic, retain)           UIImage*                alertBackgroundImage;
@property (nonatomic)                   BOOL                    isDismissByClick;
@property (nonatomic, assign)           id<TSAlertViewDelegate> delegate;

@end

@class TSAlertView;

@interface TSAlertViewManager : NSObject 
{
    // hold alert array
    NSMutableArray*			_alertArrays;
    
    // hold alert array
    NSMutableArray*			_loadingImageArrays;
    
    // the timer 
    NSTimer*                _timer;
    
    // the timer 
   // NSTimer*                _timer2;
    
    // is submitting
    BOOL                    _isSubmitting;
    
    // hold the alert view
    TSAlertView*            _alertView;
    
    // hold the submit timer (Not own)
    NSTimer*                _submitTimer;
    // Hold the image index
    int                     _submitImageIndex;
}

@property (nonatomic, assign) TSAlertView *alertView;


- (id)init;
- (void)timeOut;
- (void)cancelSubmit;
- (void) addAlertToArray:(TSAlert* )alert;

@end

